﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using InnovTech.Util.Workflow;

namespace InnovTech.Data.Dropbox.Commands
{
    public class DeleteFileCmd : WorkStep
    {
        public DeleteFileCmd(DropboxClient client, string targetFileName, string targetDir, EventHandler<WorkStepStartingEventArgs> starting = null, EventHandler<WorkStepCompletedEventArgs> completed = null):
            base(() => 
            {
                client.Open();
                client.Delete(targetFileName, targetDir);
            })
        {
            if (starting != null)
                Starting += starting;
            if (completed != null)
                Completed += completed; 
        }
    }
}
